package com.nineclock.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.system.pojo.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("select * from sys_role where  id in " +
            "(select role_id from sys_company_user_role where company_user_id = #{id} and company_id = #{companyId}) and company_id = #{companyId}")
    List<SysRole> selectRoleListByCompanyId(@Param("id") Long id,@Param("companyId") Long companyId);
}